<%@ page language="java"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html:html locale="true">
<head>
<html:base />
<title>Application Content Generator</title>
<meta http-equiv="Content-Language" content="Spanish" />
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link href="<%= request.getContextPath() %>/style/appcongen.css" rel="stylesheet" type="text/css" />

<script language="JavaScript1.2">
		function toggle(id) {
			var obj=document.getElementById(id);
			obj.style.display = (obj.style.display == 'block') ? obj.style.display = 'none' : obj.style.display = 'block';
		}
</script>

</head>

<body>

<div id="container"><%@ include
	file="/jsp/includes/common-header-menu.jsp"%>

<div id="container-content">
<h4>Listado de Posts</h4>
<logic:empty name="postListForm" property="groups">
	No existen posts.
</logic:empty>
<logic:notEmpty name="postListForm" property="groups">
	<div style="overflow:auto ; height: 350px ">
	<logic:iterate name="postListForm" property="groups" id="group">
		<div style="font-weight: bold; background: #EEF7FA; color: #FFFFFF;">
		<a href="javascript:toggle('<bean:write name="group" property="id" />')">-&nbsp;<u><bean:write name="group" property="name" /></u></a> <br />
		<hr />

		<div id="<bean:write name="group" property="id" />"	style="display: none; font-weight: normal; padding-left: 20px; background: #FFFFFF; color: #666666; ">
			
			<logic:empty name="group" property="publishedPost">
				Este grupo de noticias no tiene posts.
			</logic:empty>
			
			<logic:notEmpty name="group" property="publishedPost">
				<logic:iterate name="group" property="publishedPost" id="post">
					<span bgcolor="#F3F9FC" style="padding-left: 0px">
						Usuario:&nbsp;<b><bean:write name="post" property="user.userName" /></b><br />
						T&iacute;tulo:&nbsp;<u><a href="javascript:toggle('<bean:write name="group" property="id" />_<bean:write name="post" property="id" />')"><bean:write name="post" property="title" /></a></u><br />
						Fecha:&nbsp;<bean:write name="post" property="creationDate" /><br />
					</span>
					<br />
					<div id='<bean:write name="group" property="id" />_<bean:write name="post" property="id" />' style="display: none;padding-top: 10; background: #EEF7FA;" >
						<span>Texto:&nbsp;<bean:write name="post" property="text" />
						<br />
						</span>
						<br />
					</div>
				<hr />
				</logic:iterate>
			</logic:notEmpty>
		</div>
		</div>
	</logic:iterate>
	</div>
</logic:notEmpty>
<br />
<br />
<div style=" background-color: #FFFFFF">
	<span style="font-weight: bold;"><a href="<%=request.getContextPath() %>/postEdit.do?do=addPost">Agregar...</a></span>
</div>

</div>

<br />
<br />
<%@ include file="/jsp/includes/common-footer.jsp"%>

</div>

</body>
</html:html>
